package cn.itsource.controller.app;


import cn.dev33.satoken.stp.StpUtil;
import cn.itsource.pojo.domain.DriverAuthMaterial;
import cn.itsource.pojo.ro.DriverAuthIDRo;
import cn.itsource.pojo.ro.DriverAuthMaterialRo;
import cn.itsource.pojo.ro.RealAuthRo;
import cn.itsource.result.JSONResult;
import cn.itsource.service.IDriverAuthMaterialService;
import cn.itsource.service.IDriverSummaryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;

@Tag(name = "司机实名资料",description = "司机实名资料")
@RestController
@RequestMapping("/app/driverAuthMaterial")
public class AppDriverAuthMaterialController {

    @Autowired
    private IDriverAuthMaterialService driverAuthMaterialService;
    @Autowired
    private IDriverSummaryService driverSummaryService;

    /**
     * 认证成功调用此方法
     * @return
     */
    @GetMapping("/getDriverStatus")
    public JSONResult getDriverStatus(){
        Boolean status = driverAuthMaterialService.getDriverStatus();
        return JSONResult.success(status);
    }

    /**
     * 初始化页面
     * @return
     */
    @GetMapping("/getDriverSUmmary")
    public JSONResult getDriverSUmmary(){
        return JSONResult.success(driverSummaryService.getDriverSUmmary());
    }


    @Operation( summary= "保存DriverAuthMaterial",description = "基础对象保存接口")
    @Parameter(name = "driverAuthMaterial",description = "保存的对象",required = true)
    @PostMapping("/save")
    public JSONResult save(@RequestBody @Valid DriverAuthMaterialRo driverAuthMaterialRo){
        driverAuthMaterialService.save(driverAuthMaterialRo);
        return JSONResult.success();
    }
}
